
<?php 
include("mysqlcon.php");
mysql_select_db($dbname,$conn);
mysql_query('SET NAMES utf8');
$room_id = $_GET['room_id'];
$sql="SELECT * 
		FROM resort
			INNER JOIN reservation ON resort.room_id = reservation.room_id
			INNER JOIN customer ON reservation.id = customer.id
		WHERE reservation.reserv_status = 4
			AND resort.room_status =1
			AND resort.room_id = '".$room_id."'";
$result = mysql_query($sql);
while ($rs = mysql_fetch_array($result)){
	
	$customer_id = empty($rs['customer_id']) ? "-" : $rs['customer_id'];
	$customer_email = empty($rs['customer_email']) ? "-" : $rs['customer_email'];
	$customer_tel = empty($rs['customer_tel']) ? "-" : $rs['customer_tel'];
	$customer_address = empty($rs['customer_address']) ? "-" : $rs['customer_address'];
	$customer_fax = empty($rs['customer_fax']) ? "-" : $rs['customer_fax'];
	
	$tooltip = '<ul>';
	$tooltip .= '<li><strong>ชื่อ-นามสกุล ผู้จอง : </strong> '.$rs['customer_name'].' &nbsp; '.$rs['customer_surname'].' </li>';
	$tooltip .= ' &nbsp; ';
	$tooltip .= '<li><strong>รหัสบัตรประชาชน : </strong> '.$customer_id.' </li>';
	$tooltip .= ' &nbsp; ';
	$tooltip .= '<li><strong>E-Mail : </strong> '.$customer_email.' </li>';
	$tooltip .= ' &nbsp; ';
	$tooltip .= '<li><strong>เบอร์โทรศัพท์ : </strong> '.$customer_tel.' </li>';
	$tooltip .= ' &nbsp; ';
	$tooltip .= '<li><strong>ที่อยู่ : </strong> '.$customer_address.' </li>';
	$tooltip .= ' &nbsp; ';
	$tooltip .= '<li><strong>Fax : </strong> '.$customer_fax.' </li>';
	$tooltip .= '</ul>';
	
/*echo	"<table id='table'>";
echo	'	<tr>';
echo	'		<td>';
echo	'			<strong>ชื่อ-นามสกุล ผู้จอง : </strong>';
echo	'		</td>';
echo	'		<td>';
echo				$rs['customer_name'].' &nbsp; '.$rs['customer_surname'];
echo	'		</td>';	
echo	'	</tr>';
echo	'	<tr>';
echo	'		<td>';
echo	'			<strong>รหัสบัตรประชาชน : </strong>';
echo	'		</td>';
echo	'		<td>';
echo				$rs['customer_id'];
echo	'		</td>';	
echo	'	</tr>';
echo	'	<tr>';
echo	'		<td>';
echo	'			<strong>E-Mail : </strong>';
echo	'		</td>';
echo	'		<td>';
echo				$rs['customer_email'];
echo	'		</td>';	
echo	'	</tr>';
echo	'	<tr>';
echo	'		<td>';
echo	'			<strong>เบอร์โทรศัพท์ : </strong>';
echo	'		</td>';
echo	'		<td>';
echo				$rs['customer_tel'];
echo	'		</td>';	
echo	'	</tr>';
echo	'	<tr>';
echo	'		<td>';
echo	'			<strong>ที่อยู่ : </strong>';
echo	'		</td>';
echo	'		<td>';
echo				$rs['customer_address '];
echo	'		</td>';	
echo	'	</tr>';
echo	'	<tr>';
echo	'		<td>';
echo	'			<strong>Fax : </strong>';
echo	'		</td>';
echo	'		<td>';
echo				$rs['customer_fax'];
echo	'		</td>';	
echo	'	</tr>';					
echo	'</table>';*/

	echo $tooltip;
	
}
?>